package com.csd.action.team;

import java.util.List;

import com.csd.helper.ActionResult;
import com.csd.pojo.ProjectType;
import com.csd.service.IProjectService;
import com.csd.service.IProjectTypeService;
import com.csd.serviceImpl.ProjectService;
import com.opensymphony.xwork2.Action;

/**
 * 
 * 查询所有项目类型列表
 * 
 * @author csd
 * @version 1.0
 * 
 * <br>
 *          修订时间：2009-12-17 <br>
 *          修改原因：创建文件 <br>
 *          修改人：刘世彬
 * 
 * <br>
 * 
 */
public class ProjectTypeListAction {

	/** 查询到的项目类型列表 */
	private List<ProjectType> listOfProjectType;
	/** 项目是否可申请*/
	private Boolean enableApply;
	
	private IProjectTypeService service;

	private IProjectService pService;

	public Boolean getEnableApply() {
		return enableApply;
	}

	public void setEnableApply(Boolean enableApply) {
		this.enableApply = enableApply;
	}

	

	public void setService(IProjectTypeService service) {
		this.service = service;
	}

	public IProjectService getPService() {
		return pService;
	}

	public void setPService(IProjectService service) {
		pService = service;
	}

	public IProjectTypeService getService() {
		return service;
	}

	public List<ProjectType> getListOfProjectType() {
		return listOfProjectType;
	}

	public void setListOfProjectType(List<ProjectType> listOfProjectType) {
		this.listOfProjectType = listOfProjectType;
	}

	public String execute() {
		String result = ActionResult.fail;

		this.listOfProjectType = service.listEnableProjectType();
		this.enableApply = pService.isEnableApply();
		if (this.listOfProjectType != null) {
			result = ActionResult.success;
		}

		return result;
	}
}
